From: Håkon Hægland Date: Tue, 11 Nov 2025 18:46:32 +0000 (+0100) Subject: switcherPopup: Fix switch-group mouse click regression X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~55^2^2~28 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=6c12f4697ce1b35b4d423be81d41bcbe994fca6a;p=gnome-shell.git switcherPopup: Fix switch-group mouse click regression The LongPressGesture 'may-recognize' callback in commit 314137c8c was checking if clicks were inside '_switcherList', but thumbnails shown by switch-group are siblings of _switcherList, not children. This caused the gesture to incorrectly identify thumbnail clicks as 'outside' clicks, closing the popup before the click could complete. Fix by adding a _isActorOutside() helper method that subclasses can override to check additional containers. AppSwitcherPopup now properly checks both _switcherList and _thumbnails. Tested on Ubuntu 25.10 with GNOME Shell 49.0. Confirmed: - switch-group mouse clicks now work - switch-applications and switch-windows unaffected - clicking outside the popup still closes it correctly - no regressions introduced Fixes: 314137c8c9 ("switcherPopup: Move to a ClutterGesture for closing the popup") Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8812 Part-of: (cherry picked from commit 811364ae59340195aa1c9c3edcc0d784d39105c2) --- diff --git a/js/ui/altTab.js b/js/ui/altTab.js index 9e6e15bbf..82488e86d 100644 --- a/js/ui/altTab.js +++ b/js/ui/altTab.js @@ -294,6 +294,11 @@ class AppSwitcherPopup extends SwitcherPopup.SwitcherPopup { super._onDestroy(); } + _isActorOutside(actor) { + return super._isActorOutside(actor) && + !this._thumbnails?.contains(actor); + } + /** * _select: * diff --git a/js/ui/switcherPopup.js b/js/ui/switcherPopup.js index 790ac091e..487efbb30 100644 --- a/js/ui/switcherPopup.js +++ b/js/ui/switcherPopup.js @@ -76,7 +76,7 @@ export const SwitcherPopup = GObject.registerClass({ const actorAtCoords = global.stage.get_actor_at_pos(Clutter.PickMode.REACTIVE, coords.x, coords.y); - return !this._switcherList?.contains(actorAtCoords); + return this._isActorOutside(actorAtCoords); }); longPressGesture.connect('recognize', () => { // User clicked outside @@ -309,6 +309,10 @@ export const SwitcherPopup = GObject.registerClass({ return GLib.SOURCE_REMOVE; } + _isActorOutside(actor) { + return !this._switcherList?.contains(actor); + } + _resetNoModsTimeout() { if (this._noModsTimeoutId !== 0) GLib.source_remove(this._noModsTimeoutId);